import Vue from 'vue'
import Router from 'vue-router'
import Home from '../view/home'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'home',
      component: Home
    },
    {
      path: '/city',
      name: 'city',
      component: () => import('../view/city.vue')
    },
    {
      path: '/detail/:id',//动态路由
      name: 'Detail',
      meta: {
        keepAlive: true
      },
      component: () => import('../view/detail')
    }
  ]
})
